/*

File Filter.m

The Filter object responds to requests to open a file.  It looks up the appropriate application to use by checking the defaults database.

*/

#import "Filter.h"


/* ========================================================================== */


@implementation Filter


- (BOOL) appAcceptsAnotherFile: sender
{
	return YES;
}


- (int) app: sender  openFile: (const char *) filename
			type: (const char *) aType
{
	const char *
		app;
	
	app = NXReadDefault("Filter", aType);
	if (app == NULL)
	{
		NXLogError ("No dwrite found for type %s.", aType);
		NXBeep ();
		return NO;
	}
	
	else return [[Application  workspace]
						openFile: filename  withApplication: app];
}


@end